#ifndef _HLW8032_H
#define _HLW8032_H
/* Include------------------------------------------------------------------ */
#include "main.h"
/* ------------------------------------------------------------------------- */

/* Macros ------------------------------------------------------------------ */
#define HLW8032_NORMAL_STATU	0XF0
#define	HLW8032_CHECK_HEAD		0X5A
#define	HLW8032_REG_LEN				24
/* ------------------------------------------------------------------------- */

/* Data typedef------------------------------------------------------------- */
typedef struct {
	uint8_t stateReg;
	uint8_t checkReg;
	uint8_t volParamReg[3];
	uint8_t volReg[3];
	uint8_t curParamReg[3];
	uint8_t curReg[3];
	uint8_t powParamReg[3];
	uint8_t powReg[3];
	uint8_t dataUpReg;
	uint8_t PFReg[2];
	uint8_t checkSumReg;
}hlw8032RegListTypedef;
/* ------------------------------------------------------------------------- */

extern hlw8032RegListTypedef hlw8032RegList;

/* Function declaration----------------------------------------------------- */
void hlw8032ReadRegList(hlw8032RegListTypedef* RegList);
float hlw8032GetVoltage(void);
/* ------------------------------------------------------------------------- */

#endif//_HLW8032_H
